﻿@model TGBTech.Core.Models.DanhMuc.KhachHang

@{
    ViewBag.Title = "Khách hàng";
}

<h3>Thêm Khách hàng</h3>
<table class="table">
    <tr>
        <th>Mã khách hàng</th>
        <th>Tên khách hàng</th>
        <th>Địa chỉ</th>
        <th>Điện thoại</th>
        <th>Fax</th>
        <th>MST</th>
        <th></th>
    </tr>

    @foreach (var item in @ViewBag.List)
    {
        <tr>
            <td>@item.MaKH</td>
            <td>@item.Name</td>
            <td>@item.Address</td>
            <td>@item.Phone</td>
            <td>@item.Fax</td>
            <td>@item.MST</td>
            <td>
                @Html.ActionLink("Sửa", "Edit", new { id = item.Id }) |
                @Html.ActionLink("Xóa", "Delete", new { id = item.Id })
            </td>
        </tr>
    }

</table>

@using (Html.BeginForm("Create", "KhachHang", FormMethod.Post, new { @class = "form-inline" }))
{
    @Html.AntiForgeryToken()
    <hr />
    @Html.ValidationSummary(true, "", new { @class = "text-danger" })
    <div class="form-group" style="max-width:250px">
        @Html.EditorFor(model => model.MaKH, new { htmlAttributes = new { @class = "form-control", placeholder = "Mã khách hàng" } })
        @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control", placeholder = "Tên khách hàng" } })
    </div>

    <div class="form-group" style="max-width:250px">
        @Html.EditorFor(model => model.Address, new { htmlAttributes = new { @class = "form-control", placeholder = "Địa chỉ" } })
        @Html.EditorFor(model => model.Phone, new { htmlAttributes = new { @class = "form-control", placeholder = "Điện thoại" } })
    </div>


    <div class="form-group" style="max-width:250px">
        @Html.EditorFor(model => model.Fax, new { htmlAttributes = new { @class = "form-control", placeholder = "Số Fax" } })
        @Html.EditorFor(model => model.MST, new { htmlAttributes = new { @class = "form-control", placeholder = "Mã số thuế" } })
    </div>

        <input type="submit" value="Lưu" class="btn btn-success" />
        @Html.ActionLink("Trở về", "Index", null, new { @class = "btn btn-default" })
}


@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
